package com.tsintergy.tmosguide.datamng.serviceapi.base.pojo;

import com.tsieframework.core.base.enums.TsieEnum;
import com.tsieframework.core.base.enums.hibernate.TsieEnumTypeConvertor;

/**
 * @author longyz@tsinterg.com
 */
public enum LevelEnum implements TsieEnum {

    ONE(1, "一级"),
    TWO(2, "二级");

    private String text;
    private Integer id;

    LevelEnum(Integer id, String text) {
        this.id = id;
        this.text = text;
    }

    @Override
    public Integer getId() {
        return id;
    }

    @Override
    public String getText() {
        return text;
    }

    /**
     * 自定义转换器
     */
    public static class LevelEnumConvertor extends TsieEnumTypeConvertor<LevelEnum> {

        @Override
        protected LevelEnum getDefault() {
            return LevelEnum.ONE;
        }
    }
}
